#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>

using namespace std;

int main()
{
	string url1 = "https://en.cppreference.com/w/";
	string url ="https://legacy.cplusplus.com/reference/string/string/substr/";
	size_t pos1 = url.find(':');
	string  protocol;
	if (pos1 != string::npos)
	{
		protocol = url. substr(0, pos1);
	}
	cout << protocol << endl;
	size_t pos2 = url.find('/', pos1 + 3);

	string domain;
	string uri;
	if (pos2 != string::npos)
	{
		domain = url.substr(pos1 + 3, pos2-(pos1 + 3));
		uri = url.substr(pos2 + 1);
	}
	
	cout << domain << endl;
	cout << uri << endl;
	return 0;
}